home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / tjgold.zip / INSTALL.003 / DEMFS9.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-29  |  5KB  |  100 lines

  1. {--------------------------------------------------------------------------}
  2. {                Product: TechnoJock's Turbo Toolkit GOLD                  }
  3. {                                                                          }
  4. {                     TTT GOLD - DEMO PROGRAM                        }
  5. {                                                                          }
  6. {                Copyright 1986-1995  TechnoJock Software, Inc.            }
  7. {                           All Rights Reserved                            }
  8. {                          Restricted by License                           }
  9. {--------------------------------------------------------------------------}
  10.  
  11. {Description: DEMFS9.PAS
  12.               Illustrates how to use virtual screens to
  13.               slide images onto the display.
  14. }
  15.  
  16. program DEMFS9;
  17.  
  18. {$I GOLDFLAG.INC}
  19.  
  20. uses DOS,CRT, GoldAttr, GoldMisc, GoldFast,GoldWin,GoldKey;
  21.  
  22. procedure Welcome;
  23. {paints an introduction screen}
  24. begin
  25.    CreateScreen(3,80,25,LightBlueOnBlue);
  26.    ActivateVirtualScreen(3);          {all subsequent writes will be to screen 3}
  27.    ClearText(1,1,80,25,WhiteOnBlue);   {clear the screen with a blue background }
  28.    WriteCenter(1,WhiteOnBlue,'Virtual Screen Demonstration');  { write in middle of line 1} { white,blue }
  29.    FBox(20,5,61,15,WhiteOnRed,1);      {draw a single line filled box }
  30.    WriteAT(22,7,WhiteOnRed, 'This demo is designed to illustrate');
  31.    WriteAT(22,8,WhiteOnRed, 'the how virtual screens add pizazz to');
  32.    WriteAT(22,9,WhiteOnRed, 'applications.');
  33.    WriteAT(22,11,WhiteOnRed,'While you have been reading this, two');
  34.    WriteAT(22,12,WhiteOnRed,'other screens have been written on the');
  35.    WriteAT(22,13,WhiteOnRed,'heap.');
  36.    ActivateVisibleScreen;
  37. end; {Welcome}
  38.  
  39. procedure PrepareVirtualScreen1;
  40. { allocates a new screen on the heap and writes text to it }
  41. begin
  42.    CreateScreen(1,80,25,LightBlueOnBlue); {create a new screen - referred to as screen 1}
  43.    ActivateVirtualScreen(1);   {all subsequent writes will be to screen 1}
  44.    ClearText(1,1,80,25,YellowOnGreen); {clear the screen on the heap}
  45.    WriteCenter(1,YellowOnGreen,'Virtual Screens'); {write a heading in the center of line 1}
  46.    HorizLine(15,65,2,YellowOnGreen,2);   {draw a double line}
  47.    WritePlain(10,4,'Virtual screens have all the characteristics of the visible');
  48.    WritePlain(10,5,'screen. The main advantage of virtual screens is that they can');
  49.    WritePlain(10,6,'be prepared while the user is viewing a different image.');
  50.    WritePlain(10,8,'They are very useful for preparing screens that you want');
  51.    WritePlain(10,9,'to slide onto the display. This screen was prepared while you');
  52.    WritePlain(10,10,'were viewing the welcome screen.');
  53.    GotoXY(43,10);                {GotoXY works on virtual screens as well}
  54.    ActivateVisibleScreen;      {set subsequent writes to the visble screen}
  55. end; {PrepareVirtualScreen1}
  56.  
  57. procedure PrepareVirtualScreen2;
  58. { allocates a new screen on the heap and writes text to it }
  59. begin
  60.    CreateScreen(2,80,25,LightBlueOnBlue);  {create a new screen - referred to as screen 2}
  61.    ActivateVirtualScreen(2);              {all subsequent writes will be to screen 2}
  62.    ClearText(1,1,40,25,WhiteOnRed);        {clear the screen on the heap}
  63.    ClearText(41,1,80,25,BlackOnLightGray); {clear the screen on the heap}
  64.    WritePlain(28,1,'This was written with Plainwrite');  {use default display colors}
  65.    Fillscreen(10,5,25,10,WhiteOnRed,'*');
  66.    CopyScreenBlock(10,5,25,10,50,15);  {the copy and move operations work on the virtual screen}
  67.    CopyScreenBlock(10,5,25,10,10,15);  {the copy and move operations work on the virtual screen}
  68.    MoveScreenBlock(10,15,25,20,30,18);
  69.    ActivateVisibleScreen;              {set subsequent writes to the visble screen}
  70. end; { PrepareVirtualScreen1}
  71.  
  72. procedure PressAKey;
  73. {display a message in a single lined box}
  74. begin
  75.    TempMessageBox(50,20,BlackOnCyan,1,'Press any key to continue');
  76. end; {PressAKey}
  77.  
  78. begin    {main program}
  79. {$IFOPT D+}
  80.    HeapRecord;
  81. {$ENDIF}
  82.    Clear(WhiteOnBlack,'▓');
  83.    Welcome;
  84.    DelayKey(3000);
  85.    SlideRestoreScreen(3,Up);
  86.    PrepareVirtualScreen1;
  87.    PrepareVirtualScreen2;
  88.    PressAkey;
  89.    SlideRestoreScreen(1,Down);      {Display screen 1 that was created on the heap}
  90.    PressAkey;
  91.    RestoreScreen(2);
  92.    PressAKey;
  93.    DisposeScreen(1);      {release the heap space taken by the screens}
  94.    DisposeScreen(2);
  95.    DisposeScreen(3);
  96. {$IFOPT D+}
  97.    HeapCheck;
  98. {$ENDIF}
  99. end.
  100.